<?php
class Admin_Form_News extends Zend_Form{
    
    public function init(){       
        $this->setAction('add');        
        $title=new Zend_Form_Element_Text('title');        
        $title->setAttrib('class','span6 typeahead')
            ->setRequired(true)->addValidator('NotEmpty')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $newscat=new Zend_Form_Element_Select('newscat');        
        $newscat->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $newsitem=new Zend_Form_Element_Select('newsitem');        
        $newsitem->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $link=new Zend_Form_Element_Text('link');        
        $link->setAttrib('class','span6 typeahead')
            ->setRequired(true)->addValidator('NotEmpty')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $description=new Zend_Form_Element_Textarea('description');                
        $description->setAttrib('class','ckeditor')
            ->setRequired(true)->addValidator('NotEmpty')                                  
            ->removeDecorator('HtmlTag')->removeDecorator('Label');        
        
        $content=new Zend_Form_Element_Textarea('content');                
        $content->setAttrib('class','ckeditor')
            ->setRequired(true)->addValidator('NotEmpty')                                  
            ->removeDecorator('HtmlTag')->removeDecorator('Label');                            
            
        $display=new Zend_Form_Element_Checkbox('display');                
        $display->removeDecorator('HtmlTag')->removeDecorator('Label');                           
            
        $sm=new Zend_Form_Element_Button('submit');
        $sm->setAttrib('type','submit')->setAttrib('class','');
        $sm->setLabel('Save')
            ->removeDecorator('dtddwrapper');                                         
        
        $this->setDecorators(array(
                                   array('viewScript',
                                   array('viewScript'=>'/template/form_news.phtml'),
                                )));                        
           
        $this->addElements(array($title,$newscat,$newsitem,$link,$description,$content,$display,$sm));
        
                                          
    }
}